[Top] [Prev] [Next] [Bottom] [Contents]

Project Options


7

Overview

Sapphire/Web (Sapphire) uses options to make the tool configurable to most development and http environments. Setting these options to the proper values is important for Sapphire/Web to work correctly on your system. These options can be located in 3 files.

Global Options

The global options file is located in $SAPPHIRE/config/Sapphire.cfg. This file contains all of the options that can be defined in Sapphire/Web. The values in this file will be used by all users of the tool until they save their user options or change specific options in a project. There is no way to directly modify this file from Sapphire/Web. You must either edit the file using a text editor like vi or use the options editor in Sapphire/Web to define the options. Save these options to your home directory and then copy your user options file to $SAPPHIRE/config/Sapphire.cfg.

User Options

The user options file is located in $HOME/Sapphire.cfg. This file can be generated by pressing the Save Options button in the Edit pulldown menu in the Sapphire/Web Project Window. Once you save your user options, you will use these options for all of your new projects. If you want to revert back to options specified in the Global Options file, you must remove this file from your home directory.

Project Options

Project options are saved with the project. The values saved to this file are any options you change using the Options Editor while in Sapphire/Web, and replace any specified in your user or global option files.

When Sapphire/Web needs to figure out the value of an option, it first looks to see if the option is defined for the project. If the option is not defined for the project, it then looks in the user file, and then the global file.

Dynamic Options

All options supported by Sapphire/Web are checked for two key strings before being used when generating the Server Application. The first string is #user and is replaced with the value of $LOGNAME. The second string is #proj and is replaced with the name of the current project. These strings allow you set up a convention for all projects at your site. All options are checked for these special strings; however they are most useful with the options that define paths and URLs.

Project Categories

All options documented in this chapter start with a category name. There are 4 categories defined for Sapphire/Web:

Configuration Files

Configuration Files allow you to change the options defined in your project after it was generated. The values of options that are entered into the Options Editor affect how your Server Application executes. If you want to change options without going back to the tool, you may edit a configuration file with any text editor (like vi or emacs).

If the option Project.Allow Config File is set to True, Sapphire/Web will create a configuration file in your project directory that has the current value of all of the configurable options as its contents. It is up to you to copy it to the location specified in the Project.Config File Name option. Here is an example configuration file:

HTML URL : http://cezanne/~bnaugle/tut3
HTML Path : cezanne:~bnaugle/public_html/tut3
GIF URL : http://cezanne/~bnaugle/tut3
Database Name : 
Database Server : 
Database Vendor : NODEFAULT
Database User Name : sapphire
Database User Password : the passwd
Project.HTML Startup Document : index.html
Project.Print Form Args : True
Project.Print Environment : False
ORB_HOST : 
ORB_SEED : 
The syntax of the configuration file is Name : Value

Not all options can be placed into a configuration file. The example configuration file above shows all of the possible options that are allowed in a configuration file.

You may have noticed that some of the options in this configuration file do not have a Category in front of the name. These options can be found in both the Release and Test categories. Sapphire/Web does not write Release and Test in front of the option names so you can use the same configuration file in either Test or Release mode. The values put in the config file depend on how you generated your project. The Release options will be used when in Release mode; the Test options will be used when in Test mode.

When the Server Application executes and has been defined to allow a config file, it will request that file from the local http server. If the configuration file cannot be found on the local server, Sapphire will not generate an error; it will just use the hard-coded values. If the configuration file is found, all option values in the configuration file will override the hard-coded values in the Server Application.

Configuration files allow you to build a Server Application for use on several different machines. You can build and test the Server Application on one machine. After you verify that the application works, you can copy the Server Application and the HTML files needed by the Server Application to another machine. You then modify the configuration file to reflect the new machine, database and path information, and the application will now work on the new machine.

To modify a configuration file:

1. Copy the configuration file from $SAPPHIRE/config into your public HTML directory and make whatever changes you want. Give the new config file a name different than "Sapphire.cfg".

2. In the main project window of Sapphire, select Edit|Options for the Project category. Change the value of "Allow Config File" to "True". Then set the Config File Name according to the following syntax:

	/~user/file.cfg
where "user" is your username and "file.cfg" is the name of your modified configuration file.

3. Save your options and rebuilt your project.



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.